#include <bits/stdc++.h>
using namespace std;
int n;
double x;

int main() {
    cin >> x >> n;

    double sum;
    for (int i = 0; i <= n; i++) {
        sum += pow(x, i);
    }
    cout << fixed << setprecision(2) << sum;
    return 0;
}